// 导入 axios
import axios from '../../utils/request'
// 暴露 获取菜单列表
export const GetMenus = data => {
  return axios({
    method: 'GET',
    url: '/menus'
  })
}
// 获取/搜索精选题库列表
export const TestbaseList = params => {
  return axios({
    method: 'GET',
    url: '/questions/choice',
    params
  })
}
// 获取学科列表
export const getSubject = params => {
  return axios({
    method: 'GET',
    url: '/subjects',
    params
  })
}
// 获取组题列表接口
export const getSubjectList = params => {
  return axios({
    method: 'GET',
    url: '/questions/randoms',
    params
  })
}
// 获取学科二级列表
export const getSubjecSecond = params => {
  return axios({
    method: 'GET',
    url: '/subjects/simple',
    params
  })
}
// 获取菜单列表
export const getMenusList = params => {
  return axios({
    method: 'GET',
    url: '/menus',
    params
  })
}
// 确定修改
export const editChange = data => {
  return axios({
    method: 'PUT',
    url: `/menus/${data.id}`,
    data
  })
}
// 删除按钮
export const delMenus = id => {
  return axios({
    method: 'DELETE',
    url: `/menus/${id}`
  })
}
// 添加按钮
export const onAddMenus = data => {
  return axios({
    method: 'POST',
    url: '/menus/',
    data
  })
}

// 移除精选
export const delSift = id => {
  return axios({
    method: 'PATCH',
    url: `/questions/choice/${id}/0`
  })
}
